package com.ifeng.stock;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;

import com.tidemark.Consts;
import com.tidemark.Proposal;
import com.tidemark.Stock;
import com.tidemark.StockDataModel;

public class AbsoluteReader extends AbstractReader implements com.tidemark.Reader {

	public Proposal comment(Proposal input){
		throw new RuntimeException("not implemented yet");
	}

	public Proposal propose(){
		model.removeAll();
		try {
			//System.out.println(":)   :)   :)   ifeng.com ");
			compare_print(read(Constants.bigin), read(Constants.smallout),  new String(Constants.NIU, "utf-8"), Consts.BUY);
			//System.out.println(":(   :(   :(   ifeng.com ");
			compare_print(read(Constants.bigout), read(Constants.smallin),  new String(Constants.XIONG, "utf-8"), Consts.SALE);
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return new Proposal(this, this.model, null);
	}
		
	public AbsoluteReader(StockDataModel model){
		if(model == null){
			throw new NullPointerException("stock data model must not be null.");
		}
		this.model = model;
	}
}
